www.gusucode.com > XerCMS 携云PHP企业建站程序 v2015PHP源码程序 > XerCMS 携云PHP企业建站程序 v2015/XerCMS_v20150724/XerCMS_v20150724/Assets/editor/php/action_list.php

    <?php
!defined('XERCMS') && exit('Access Denied');
 
if($action == 'listimage') {
     $start = (int)$_GET['start'];
     $start = $start < 0 ? $start : 0;
     $size  = (int)$_GET['size'];
     $size  = $size < $start ? ($start + 1) : $size;
     $files = DB::fetch_all('SELECT `url`,`time` as mtime FROM xercms_member_upfiles WHERE `type` = 2 AND uid = \''.X::$G['uid'].'\' ORDER BY id DESC LIMIT '.$start.','.$size);
 
     return json_encode(array(
          "state" => 'SUCCESS',
          "list" => $files,
          "start" => 0,
          "total" => count($files)
     )); 
} else if($action == 'listfile') {
     $start = (int)$_GET['start'];
     $start = $start < 0 ? $start : 0;
     $size  = (int)$_GET['size'];
     $size  = $size < $start ? ($start + 1) : $size;
     $files = DB::fetch_all('SELECT `url`,`time` as mtime FROM xercms_member_upfiles WHERE `type` = 3 AND uid = \''.X::$G['uid'].'\' ORDER BY id DESC LIMIT '.$start.','.$size);
 
     return json_encode(array(
          "state" => 'SUCCESS',
          "list" => $files,
          "start" => 0,
          "total" => count($files)
     )); 
} else {
     return json_encode(array(
          "state" => "no match file",
          "list" => array(),
          "start" => 0,
          "total" => 0
     ));
}
?>